<?php

class AlbumController extends ShopController {
	public $defaultAction = 'list';
	/**
	 * listAction 列表
	 * viewAction 详情
	 */
	public function actionList() {
		$provider = $this->getProvider();
		$modelName = $provider->companyModelName();
		$model = new $modelName();
		if (isset($_GET[$modelName])) {
			$model->attributes = $_GET[$modelName];
		}
		$this->render('list',array(
			'data' => $provider->photoSearch(9),
		));	
	}
	
	public function actionView($id) {
		$provider = $this->getProvider();
		$modelName = $provider->companyModelName().'Album';
		$model = new $modelName;
		$model->object_id = $id;
		if (isset($_GET[$modelName])) {
			$model->attributes = $_GET[$modelName];
		}
		$this->render('view',array(
			'data' => $model->search(),
		));	
	}
}

?>